package com.only4play.productcenter.api.constants;

import com.only4play.common.constants.BaseEnum;

import java.util.Optional;

/**
 * @author hinzzz www.hinzzz.cn 157957329@qq.com
 * 2024-02-27
 */
public enum InOutStoreType implements BaseEnum<InOutStoreType> {
  
  IN_INIT(1, "初始入库"),
  IN_RETURN(2, "退货入库"),
  IN_TRANSFER(3, "调拨入库"),
  OUT_TRANSFER(4, "调拨出库"),
  OUT_RETURN(5, "退货出库"),
  OUT_PRODUCE(6, "生产出库"),
  IN_PRODUCE(7, "生产入库"),

    ;

  InOutStoreType(Integer code, String name) {
    this.code = code;
    this.name = name;
  }

  private Integer code;
  private String name;

  @Override
  public Integer getCode() {
    return this.code;
  }

  @Override
  public String getName() {
    return this.name;
  }

  public static Optional<InOutStoreType> of(Integer code) {
    return Optional.ofNullable(BaseEnum.parseByCode(InOutStoreType.class, code));
  }

}